Methods for encoding and decoding pictures and associated apparatus

ABSTRACT

A method for decoding a picture, a method for encoding a picture, an encoder, and a decoder are provided. The method for encoding a picture includes (i) determining a width and a height of a coding block in the picture; (ii) if the width and the height are equal to N, where N is a positive integer power of 2, determining a matrix-based intra prediction (MIP) size identifier indicating that an MIP prediction size equal to N; (iii) deriving a group of reference samples of the coding block; and (iv) deriving an MIP prediction of the coding block based on the group of reference samples and an MIP matrix corresponding to the MIP size identifier.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a continuation of International Application No.PCT/CN2019/124365, filed on Dec. 10, 2019, the disclosure of which ishereby incorporated by reference in its entirety.

TECHNICAL FIELD

The present disclosure relates to the field of telecommunicationtechnologies, and in particular, to a method for encoding and decodingpictures such as pictures or videos.

BACKGROUND

Versatile Video Coding (VVC) is a next generation video compressionstandard used to replace a current standard such as High EfficiencyVideo Coding standard (H.265/HEVC). The VVC coding standard provideshigher coding quality than the current standard. To achieve this goal,various intra and inter prediction modes are considered. When usingthese prediction modes, a video can be compressed such that data to betransmitted in a bitstream (in binary form) can be reduced. Matrix-basedIntra Prediction (MIP) is one of these modes. The MIP is an intraprediction mode. When implementing under the MIP mode, an encoder (orcoder) or a decoder can derive an intra prediction block based on acurrent block (e.g., a group of bits or digits that is transmitted as aunit and that may be encoded and/or decoded together). However, derivingsuch prediction blocks may require significant amount of computationalresources and additional storage spaces. Therefore, an improved methodfor addressing this issue is advantageous and desirable.

SUMMARY

In an aspect, a method for encoding a picture is provided. The methodincludes the following. A width and a height of a coding block in thepicture is determined. If the width and the height are equal to N, amatrix-based intra prediction (MIP) size identifier is determined, whereN is a positive integer power of 2, and the MIP size identifierindicates that an MIP prediction size equal to N. A group of referencesamples of the coding block is derived. An MIP prediction of the codingblock is derived based on the group of reference samples and an MIPmatrix according to the MIP size identifier.

In another aspect, a method for decoding a picture is provided. Themethod includes the following. A bitstream is parsed to determine awidth, a height and a prediction mode of a coding block. When theprediction mode indicates a MIP mode is used in decoding the codingblock, if the width and the height are equal to N, an MIP sizeidentifier is determined, where the MIP size identifier indicates thatan MIP prediction size equal to N, and N is a positive integer power of2. A group of reference samples of the coding block is derived. An MIPprediction of the coding block is derived based on the group ofreference samples and an MIP matrix corresponding to the MIP sizeidentifier.

In another aspect, an encoding apparatus for encoding a picture isprovided. The encoding apparatus includes a partition unit, a predictionunit, and an entropy coding unit. The partition unit is configured toreceive an input picture and divide the input picture into one or morecoding blocks. The prediction unit is configured to determine a widthand a height of the coding block. If the width and the height are equalto N, the prediction unit is configured to determine a MIP sizeidentifier indicating that an MIP prediction size equal to N. N is apositive integer power of 2. The prediction unit is configured to derivea group of reference samples of the coding block, and the predictionunit is configured to derive an MIP prediction of the coding block basedon the group of reference samples and an MIP matrix according to the MIPsize identifier. The entropy coding unit is configured to transformparameters to derive the MIP prediction into a bitstream.

In another aspect, a decoding apparatus for decoding a picture isprovided. The decoding apparatus includes a parsing unit and an intraprediction unit. The parsing unit is configured to parse a bitstream todetermine a width, a height and a prediction mode of a coding block. Theintra prediction unit is configured to, when the prediction modeindicates a MIP mode is used in decoding the coding block, determine anMIP size identifier indicating that an MIP prediction size equal to N,if the width and the height are equal to N, where N is a positiveinteger power of 2. The intra prediction unit is configured to derive agroup of reference samples of the coding block, and the intra predictionunit is configured to derive an MIP prediction of the coding block basedon the group of reference samples and an MIP matrix corresponding to theMIP size identifier.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to make the technical solution described in the embodiments ofthe present disclosure more clearly, the drawings used for thedescription of the embodiments will be briefly described. Apparently,the drawings described below are only for illustration, but not forlimitation. It should be understood that, one skilled in the art mayacquire other drawings based on these drawings, without making anyinventive work.

FIG. 1 is a schematic diagram of a system according to an embodiment ofthe present disclosure.

FIG. 2 is a schematic diagram of an encoding system according to anembodiment of the present disclosure.

FIG. 3 is a schematic diagram illustrating derivation of an intraprediction block using an MIP mode in accordance with embodiments of thepresent disclosure.

FIG. 4 is a schematic diagram of a decoding system according to anembodiment of the present disclosure.

FIG. 5 is a schematic diagram of an apparatus (e.g., encoder) accordingto an embodiment of the present disclosure.

FIG. 6 is a schematic diagram of an apparatus (e.g., decoder) accordingto an embodiment of the present disclosure.

FIG. 7 is a schematic diagram of a communication system according to anembodiment of the present disclosure.

DETAILED DESCRIPTION

In order to facilitate the understanding of the present disclosure, thepresent disclosure will be described more fully hereinafter withreference to the accompanying drawings.

Under a current MIP mode, to generate a prediction block of a currentblock, the size of the prediction block is smaller than the size of thecurrent block. For example, an “8×8” current block can have a “4×4”prediction block. Under the current MIP mode, an MIP prediction blockwith its size smaller than the current block is derived by performing amatrix calculation, which consumes less computational resources thanperforming the matrix calculation with a larger block. After the matrixcalculation, an upsampling process is applied to the MIP predictionblock to derive an intra prediction block that is of the same size ofthe current block. For example, an “8×8” intra prediction block can bederived from a “4×4” MIP prediction block by invoking the upsamplingprocess of interpolation and/or extrapolation. The present disclosureprovides a method for implementing the MIP mode without the up-samplingprocess, thereby significantly reducing computational complexity andincreasing overall efficiency. More particularly, when implementing theMIP mode, the present method determines a suitable size identifier (oran MIP size identifier) such that the size of an MIP prediction block(e.g., “8×8”) is the same as the size of a current block (“8×8”) suchthat there is no need to perform an up-sampling process.

Embodiments of the present disclosure provide a method for encoding apicture. The method can also be applied to encode a video consisting ofa sequence of pictures. The method includes, for example, (i)determining a width and a height of a coding block (e.g., an encodingblock) in a picture; (ii) if the width and the height are “N,” (“N” is apositive integer power of 2), determining a matrix-based intraprediction (MIP) size identifier, indicating that an MIP prediction sizeequal to “N;” (iii) deriving a group of reference samples for the codingblock (e.g., using neighboring samples of the coding block); (iv)deriving an MIP prediction of the coding block using the group ofreference samples and an MIP weight matrix according to the MIP sizeidentifier; and (v) setting a prediction of the coding block equal tothe MIP prediction of the coding block. In some embodiment, the methodfurther comprises generating a bitstream based on the prediction of thecoding block.

According to another aspect of the present disclosure, the method fordecoding a picture can include, for example, (a) parsing a bitstream todetermine a width, a height and a prediction mode (e.g., whether thebitstream indicates that an MIP mode was used) of a coding block (e.g.,a decoding block); (b) if the width and the height are “N” and the MIPmode was used, determining an MIP size identifier indicating that an MIPprediction size equal to “N” (“N” is a positive integer power of 2); (c)deriving a group of reference samples for the coding block (e.g., usingneighboring samples of the coding block); (d) deriving an MIP predictionof the coding block using the group of reference samples and an MIPmatrix according to the MIP size identifier; (e) setting a prediction ofthe coding block equal to the MIP prediction of the coding block.

In some embodiments, the MIP prediction can include “N×N” predictionsamples (e.g., “8×8”). In some embodiments, the MIP matrix can beselected from a group of predefined MIP matrices.

Another aspect of the present disclosure includes a system forencoding/decoding pictures and videos. The system can include anencoding sub-system (or an encoder) and a decoding sub-system (or adecoder). The encoding sub-system includes a partition unit, a firstprediction unit, and an entropy coding unit. The partition unit isconfigured to receive an input video and divide the input video into oneor more coding units (CUs). The first intra prediction unit isconfigured to generate a prediction block corresponding to each CU andan MIP size identifier derived from encoding the input video. Theentropy coding unit is configured to transform the parameters forderiving the prediction block into a bitstream. The decoding sub-systemincludes a parsing unit and a second intra prediction unit. The parsingunit is configured to parse the bitstream to get numerical values (e.g.,values associated with the one or more CUs). The second intra predictionunit is configured to convert the numerical values into an output videoat least partially based on the MIP size identifier.

A CU may have a width and a height equal to “N,” and “N” is a positiveinteger power of 2. The MIP size identifier indicates that an MIPprediction size used by the first intra prediction unit to generate anMIP prediction block is “N.” For example, the MIP size identifier equalto “2” indicates that the MIP prediction size is “8×8”.

FIG. 1 is a schematic diagram of a system 100 according to an embodimentof the present disclosure. The system 100 can encode, transmit, anddecode a picture. The system 100 can also be applied to encode, transmitand decode a video consisting of a sequence of pictures. Moreparticularly, the system 100 can receive input pictures, process theinput pictures, and generate output pictures. The system 100 includes anencoding apparatus 100 a and a decoding apparatus 100 b. The encodingapparatus 100 a includes a partition unit 101, a first intra predictionunit 103, and an entropy coding unit 105. The decoding apparatus 100 bincludes a parsing unit 107 and a second intra prediction unit 109.

The partition unit 101 is configured to receive an input video 10 andthen divide the input video 10 into one or more coding tree units (CTUs)or coding units (CUs) 12. The CUs 12 are transmitted to the first intraprediction unit 103. The first intra prediction unit 103 is configuredto derive a prediction block for each of the CUs 12 by performing an MIPprocess. Based on the sizes of the CUs 12, the MIP process has differentapproaches to handle the CUs 12 with different sizes. For each type ofCUs 12, it has a designated MIP size identifier (e.g., 0, 1, 2, etc.).The MIP size identifier is used to derive a size of an MIP predictionblock (i.e. a variable “predSize”), a number of reference samples froman above or left boundary of the CU (i.e. a variable “boundarySize”) andto select MIP matrix from a number of predefined MIP matrices. Forexample, when the MIP size identifier is “0,” the size of the MIPprediction block is “4×4” (e.g., “predSize” is set equal to 4) and“boundarySize” is set equal to 2; when MIP size identifier is “1,”“predSize” is set equal to 4 and boundarySize is set equal to 2; andwhen MIP size identifier is “2,” “predSize” is set equal to 8 and“boundarySize” is set equal to 4.

The first intra prediction unit 103 first determines a width and aheight of the CU 12. For example, the first intra prediction unit 103can determine that the CU 12 has a height of “8” and a width of “8.” Inthis example, the width and the height are “8.” Accordingly, the firstintra prediction unit 103 determines that the MIP size identifier of theCU 12 is “2,” which indicates that the size of MIP prediction is “8×8.”The first intra prediction unit 103 further derives a group of referencesamples for the CU 12 (e.g., using neighboring samples of the CU 12,such as above- or left-neighboring samples, discussed in detail withreference to FIG. 3). The first intra prediction unit 103 then derivesan MIP prediction of the CU 12 based on the group of reference samplesand corresponding MIP matrix. The first intra prediction unit 103 canuse the MIP prediction as an intra prediction 14 of the CU 12. The intraprediction 14 and parameters for deriving the intra prediction 14 arethen transmitted to the entropy coding unit 105 for further process.

The entropy coding unit 105 is configured to transform the parametersfor deriving the intra prediction 14 into binary form. Accordingly, theentropy coding unit 105 generates a bitstream 16 based on the intraprediction 14. In some embodiments, the bitstream 16 can be transmittedvia a communication network or stored in a disc or a server.

The decoding apparatus 100 b receives the bitstream 16 as inputbitstream 17. The parsing unit 107 parses the input bitstream 17 (inbinary form) and converts it into numerical values 18. The numericalvalues 18 is indicative of the characteristics (e.g., color, brightness,depth, etc.) of the input video 10. The numerical values 18 istransmitted to the second intra prediction unit 109. The second intraprediction unit 109 can then convert these numerical values 18 into anoutput video 19 (e.g., based on processes similar to those performed bythe first intra prediction unit 103; relevant embodiments are discussedin detail with reference to FIG. 4). The output video 19 can then bestored, transmitted, and/or rendered by an external device (e.g., astorage, a transmitter, etc.). The stored video can further be displayedby a display.

FIG. 2 is a schematic diagram of an encoding system 200 according to anembodiment of the present disclosure. The encoding system 200 isconfigured to encode, compress, and/or process an input picture 20 andgenerate an output bitstream 21 in binary form. The encoding system 200includes a partition unit 201 configured to divide the input picture 20into one or more coding tree units (CTUs) 22. In some embodiments, thepartition unit 201 can divide the picture into slices, tiles, and/orbricks. Each of the bricks can contain one or more integral and/orpartial CTUs 22. In some embodiments, the partition unit 201 can alsoform one or more subpictures, each of which can contain one or moreslices, tiles or bricks. The partition unit 201 transmits the CTUs 22 toa prediction unit 202 for further process.

The prediction unit 202 is configured to generate a prediction block 23for each of the CTUs 22. The prediction block 23 can be generated basedon one or more inter or intra prediction methods by using variousinterpolation and/or extrapolation schemes. As shown in FIG. 2, theprediction unit 202 can further include a block partition unit 203, anME (motion estimation) unit 204, an MC (motion compensation) unit 205,and an intra prediction unit 206. The block partition unit 203 isconfigured to divide the CTUs 22 into smaller coding units (CUs) orcoding blocks (CBs). In some embodiments, the CUs can be generated fromthe CTUs 22 by various methods such as quadtree split, binary split, andternary split. The ME unit 204 is configured to estimate a changeresulting from a movement of an object shown in the input picture 20 ora movement of a picture capturing device that generates the inputpicture 20. The MC unit 205 is configured to adjust and compensate achange resulting from the foregoing movement. Both the ME unit 204 andthe MC unit 205 are configured to derive an inter (e.g., at differenttime points) prediction block of a CU. In some embodiments, the ME unit204 and the MC unit 205 can use a rate-distortion optimized motionestimation method to derive the inter prediction block.

The intra prediction unit 206 is configured to derive an intra (e.g., atthe same time point) prediction block of a CU (or a portion of the CU)using various intra prediction modes including MIP modes. Details ofderiving of an intra prediction block using an MIP mode (referred to as“MIP process” hereinafter) is discussed with reference to FIG. 3. Duringthe MIP process, the intra prediction unit 206 first derives one or morereference samples from neighboring samples of the CU, by, for example,directly using the neighboring samples as the reference samples,downsampling the neighboring samples, or directly extracting from theneighboring samples (e.g., Step 301 of FIG. 3).

Second, the intra prediction unit 206 derives predicted samples atmultiple sample positions in the CU using the reference samples, an MIPmatrix and a shifting parameter. The sample positions can be presetsample positions in the CU. For example, the sample positions can bepositions with odd horizontal and vertical coordinate values within theCU (e.g., x=1, 3, 5, etc.; y=1, 3, 5, etc.). The shifting parameterincludes a shifting offset parameter and a shifting number parameter,which can be used in shifting operations in generating the predictedsamples. By this arrangement, the intra prediction unit 206 can generatepredicted samples in the CU (i.e., “MIP prediction” or “MIP predictionblock” refers to a collection of such predicted samples) (e.g., Step 302of FIG. 3). In some embodiments, the sample positions can be positionswith even horizontal and vertical coordinate values within the CU.

Third, the intra prediction unit 206 can derive predicted samples atremaining positions (e.g., those are not sample positions) of the CU(e.g., Step 303 of FIG. 3). In some embodiments, the intra predictionunit 206 can use an interpolation filter to derive the predicted samplesat the remaining positions. By the foregoing processes, the intraprediction unit 206 can generate the prediction block 23 for the CU inthe CTU 22.

Referring to FIG. 2, the prediction unit 202 outputs the predictionblock 23 to an adder 207. The adder 207 calculates a difference (e.g., aresidual R) between the output (e.g., a CU in the CTUs 22) of thepartition unit 201 and the output (i.e., the prediction block 23 of theCU) of the prediction block 202. A transform unit 208 reads the residualR, and performs one or more transform operations on the prediction block23 to get coefficients 24 for further uses. A quantization unit 209 canquantize the coefficients 24 and outputs quantized coefficients 25(e.g., levels) to an inverse quantization unit 210. The inversequantization unit 210 performs scaling operations on the quantizedcoefficients 25 to output reconstructed coefficients 26 to an inversetransform unit 211. The inverse transform unit 211 performs one or moreinverse transforms corresponding to the transforms in the transform unit208 and outputs reconstructed residual 27.

An adder 212 then calculates reconstructed CU by adding thereconstructed residual 27 and the prediction block 23 of the CU from theprediction unit 202. The adder 212 also forwards its output 28 to theprediction unit 202 to be used as an intra prediction reference. Afterall the CUs in the CTUs 22 have been reconstructed, a filtering unit 213can perform an in-loop filtering on a reconstructed picture 29. Thefiltering unit 213 contains one or more filters, for example, adeblocking filter, a sample adaptive offset (SAO) filter, an adaptiveloop filter (ALF), a luma mapping with chroma scaling (LMCS) filter, aneural-network-based filter and other suitable filters for suppressingcoding distortions or enhancing coding quality of a picture.

The filtering unit 213 can then send a decoded picture 30 (orsubpicture) to a decoded picture buffer (DPB) 214. The DPB 214 outputsdecoded picture 31 based on controlling information. The picture 31stored in the DPB 214 may also be employed as a reference picture forperforming inter or intra prediction by the prediction unit 202.

An entropy coding unit 215 is configured to convert the pictures 31,parameters from the units in the encoding system 200, and supplementalinformation (e.g., information for controlling or communicating with thesystem 200) into binary form. The entropy coding unit 215 can generatethe output bitstream 21 accordingly.

In some embodiments, the encoding system 200 can be a computing devicewith a processor and a storage medium with one or more encodingprograms. When the processor reads and executes the encoding programs,the encoding system 200 can receive the input picture 20 and accordinglygenerates the output bitstream 21. In some embodiments, the encodingsystem 200 can be a computing device with one or more chips. The unitsor elements of the encoding system 200 can be implemented as integratedcircuits on the chips.

FIG. 3 is a schematic diagram illustrating an MIP process in accordancewith embodiments of the present disclosure. The MIP process can beimplemented by an intra prediction unit (e.g., the intra prediction unit206). As shown in FIG. 3, the intra prediction unit can include aprediction module 301 and a filtering module 302. As also shown in FIG.3, the MIP process includes three Steps 301, 302, and 303. The MIPprocess can generate a predicted block based on a current block or acoding block 300 (such as a CU or partitions of a CU).

Step 301

In Step 301, the intra prediction unit can use neighboring samples 31,33 of the coding block 300 to generate reference samples 32, 34. In theillustrated embodiment, the neighboring samples 31 are above-neighboringsamples, and the neighboring samples 33 are left-neighboring samples.The intra prediction unit 206 can calculate an average of the values ofevery two neighboring samples 31, 33 and set the average of the valuesas the values of the reference samples 32, 34, respectively. In someembodiments, the intra prediction unit 206 can select the value of onefrom every two neighboring samples 31 or 33 as the value of thereference sample 32 or 32. In the illustrated embodiments, the intraprediction unit 206 derives 4 reference samples 32 from 8above-neighboring samples 31 of the coding block 300, and another 4reference samples 34 from 8 left-neighboring samples 33 of the codingblock 300.

In Step 301, the intra prediction unit determines a width and a heightof the coding block 300 and denotes them as variables “cbWidth” and“cbHeight,” respectively. In some embodiments, the intra prediction unit206 can adopt a rate-distortion optimized mode decision process todetermine an intra prediction mode (e.g., whether an MIP mode is used).In such embodiments, the coding block 300 can be partitioned into one ormore transform blocks, whose width and height are noted as variables“nTbW” and “nTbH,” respectively. When the MIP mode is used as the intraprediction mode, the intra prediction unit determines an MIP sizeidentifier (denoted as variable “mipSizeId”) based on the followingconditions A-C.

[CONDITION A] If both “nTbW” and “nTbH” are 4, set “mipSizeId” as 0.

[CONDITION B] Otherwise, if either “cbWidth” or “cbHeight” is 4, set“mipSizeId” as 1.

[CONDITION C] Otherwise, set “mipSizeId” as 2.

As an example, if the size of the coding block 300 is “8×8” (i.e. both“cbWidth” and “cbHeight” are 8), then “mipSizeId” is set as 2. Asanother example, if the size of the transformed block of the codingblock 300 is “4×4” (i.e. both “nTbW” and “nTbH” are 4), then “mipSizeId”is set as 0. As yet another example, if the size of the coding block 300is “4×8,” then “mipSizeId” is set as 1.

In the illustrated embodiments, there are three types of “mipSizeId,”which are “0,” “1,” and “2.” Each type of MIP size identifiers (i.e.,variable “mipSizeId”) corresponds to a specific way of performing theMIP process (e.g., use different MIP matrices). In other embodiments,there can be more than three types of MIP size identifiers.

Based on the MIP size identifier, the intra prediction unit candetermine variables “boundarySize” and “predSize” based on the followingconditions D-F.

[CONDITION D] If “mipSizeId” is 0, set “boundarySize” as 2 and“predSize” as 4.

[CONDITION E] If “mipSizeId” is 1, set “boundarySize” as 4 and“predSize” as 4.

[CONDITION F] If “mipSizeId” is 2, set “boundarySize” as 4 and“predSize” as 8.

In the illustrated embodiments, “boundarySize” represents a number ofreference samples 32, 34 derived from each of the above-neighboringsamples 31 and the left-neighboring samples 33 of the coding block 300.Variable “predSize” is to be used in a later calculation (i.e., equation(C) below).

In some embodiments, the intra prediction unit can also derive variable“isTransposed” to indicate the order of reference samples 32, 34 storedin a temporal array. For example, “isTransposed:” being 0 indicates thatthe intra prediction unit presents the reference samples 32 derived fromthe above-neighboring samples 31 of the coding block 300 ahead of thereference samples 34 derived from the left-neighboring samples 33.Alternatively, “isTransposed” being 1 indicates that the intraprediction unit presents the reference samples 34 derived from theleft-neighboring samples 33 of the coding block 300 ahead of thereference samples 32 derived from the above-neighboring samples 31. Inan implementation of the encoding system 200, the value of“isTransposed” is sent to an entropy coding unit (e.g., the entropycoding unit 215) as one of the parameters of the MIP process that iscoded and written into a bitstream (e.g., the output bitstream 21).Correspondingly, in an implementation of a decoding system 400 in FIG. 4described in this disclosure, the value of “isTransposed” can bereceived from a parsing unit (e.g., parsing unit 401) by parsing aninput bitstream (which can be the output bitstream 21).

The intra prediction unit can further determine a variable “inSize” toindicate the number of reference samples 32, 34 used in deriving an MIPprediction. A value of “inSize” is determined by the following equation(A). In this disclosure, meanings and operations of all operators inequations are the same as the counterpart operators that are defined inthe ITU-T H.265 standard.

$\begin{matrix}{{{inSize} = {\left( {2*{boundarySize}} \right) - {{\left( {{mipSizeId}==2} \right)?1}\text{:}0}}};} & (A)\end{matrix}$

For example, “==” is a relational operator “Equal to”. For example, if“mipSizeId” is 2, then “inSize” is 7 (calculated by (2*4)-1). If“mipSizeId” is 1, then “inSize” is 8 (calculated by (2*4)-0).

The intra prediction unit can invoke the following process to derive agroup of reference samples 32, 34, which are stored in array p[x] (“x”is from “0” to “inSize-1”). The intra prediction unit can derive “nTbW”samples from the above-neighboring samples 31 of the coding block 300(and store them in array “refT”) and “nTbH” samples from theleft-neighboring samples 33 (and store them in array “refL”) of thecoding block 300.

The intra prediction unit can initial a downsampling process on “refT”to get “boundarySize” samples and store the “boundarySize samples” in“refT.” Similarly, the intra prediction unit 206 can initiate thedownsampling process on “refL” to get “boundarySize” samples and storethe “boundarySize” samples in “refL.”

In some embodiments, the intra prediction unit can incorporate arrays“refT” and “refL” into a single array “pTemp” based on the orderindicated by a variable “isTransposed.” The intra prediction unit canderive “isTransposed” to indicate the order of reference samples storedin a temporal array “pTemp.” For example, “isTransposed” being 0 (orFALSE) indicates that the intra prediction unit presents the referencesamples 32 derived from the above-neighboring samples 31 of the codingblock 300 ahead of the reference samples 34 derived from theleft-neighboring samples 33. In other cases, “isTransposed” being 1 (orTRUE) indicates that the intra prediction unit presents the referencesamples 34 derived from the left-neighboring samples 33 of the codingblock 300 ahead of the reference samples 32 derived from theabove-neighboring samples 31. In some embodiments, in an implementationof the encoding system 200, the intra prediction unit can determine avalue of “isTransposed” by using a rate-distortion optimization method.In some embodiments, in an implementation of the encoding system 200,the intra prediction unit can determine the value of “isTransposed”based on comparisons and/or correlations between neighboring samples 32,34 and the coding block 300. In an implementation of the encoding system200, the value of “isTransposed” can be forwarded to the entropy codingunit (e.g., the entropy coding unit 215) as one of the parameters of theMIP process to be written in the bitstream (e.g., the output bitstream21). Correspondingly, in an implementation of a decoding system 400 inFIG. 4 described in this disclosure, the value of “isTransposed” can bereceived from a parsing unit (e.g. parsing unit 401) by parsing an inputbitstream (which can be the output bitstream 21).

The intra prediction unit can determine array p[x] (x from “0” to“inSize-1”) based on the following conditions G and H.

[CONDITION G] If “mipSizeId” is 2, p[x]=pTemp[x+1]−pTemp[0].

[CONDITION H] Otherwise (e.g., “mipSizeId” is less than 2),p[0]=pTemp[0]−(1<<(BitDepth-1)) and p[x]=pTemp[x]−pTemp[0] (for x from 1to “inSize-1”).

In the above condition H, “BitDepth” is a bitdepth of a color componentof a sample (e.g., Y component) in the coding block 300. The symbol “<<”is a bit shifting symbol used in the ITU-T H.265 standard.

Alternatively, the intra prediction unit can derive array p[x] (for xfrom 0 to “inSize-1” based on the following conditions I and J.

[CONDITION I] If “mipSizeId” is 2, p[x]=pTemp[x+1]−pTemp[0].

[CONDITION J] Otherwise (e.g., “mipSizeId” is less than 2),p[0]=(1<<(BitDepth-1))-pTemp[0] and p[x]=pTemp[x]−pTemp[0] (for x from 1to “inSize-1”).

In some embodiments, the intra prediction unit can determine the valuesof array p[x] by using a unified calculation method without judging thevalue of “mipSizeId.” For example, the intra prediction unit can append“(1<<(BitDepth-1))” as an additional element in “pTemp,” and calculatep[x] as “pTemp[x]−pTemp[0].”

Step 302

In Step 302, the intra prediction unit (or the prediction module 301)derives the MIP prediction of the coding block 300 by using the group ofreference samples 32, 34 and an MIP matrix. The MIP matrix is selectedfrom a group of predefined MIP matrices based on its corresponding MIPmode identifier (i.e., variable “mipModeId”) and the MIP size identifier(i.e. variable “mipSizeId”).

The MIP prediction derived by the intra prediction unit includes partialpredicted samples 35 of all or partial sample positions in the codingblock 300. The MIP prediction is denoted as “predMip[x][y].”

In the illustrated embodiment in FIG. 3, partial predicted samples 35are samples marked as grey squares in the current block 300. Thereference samples 32, 34 in array p[x] derived in Step 301 are used asan input to the prediction module 301. The prediction module 301calculates the partial predicted samples 35 by using the MIP matrix anda shifting parameter. The shifting parameter includes a shifting offsetparameter and a shifting number parameter. In some embodiment, theprediction module 301 derives the partial predicted sample 35 with itscoordinate (x, y) based on the following equations (B) and (C):

$\begin{matrix}{{oW} = {\left( {{1{\operatorname{<<}{(sW}}}\; - 1} \right) - {{fO}*\left( {\sum\limits_{i - 0}^{{inSize} - 1}\;{p\lbrack i\rbrack}} \right)}}} & (B) \\{{{{predMip}\lbrack x\rbrack}\lbrack y\rbrack} = {\left( {\left( {\left( {\sum\limits_{1 = 0}^{{inSize} - 1}{{mWeight}\left\lfloor i \right\rfloor\left\lfloor {{y*{predSize}} + x} \right\rfloor*p\left\lfloor i \right\rfloor}} \right) + {oW}} \right)\operatorname{>>}{sW}} \right) + {{pTemp}\lbrack 0\rbrack}\left( {{for}\mspace{14mu} x\mspace{14mu}{from}\mspace{14mu} 0\mspace{14mu}{to}\mspace{14mu}{``{{predSize} - 1}"}} \right)}} & (C)\end{matrix}$

In equation (B) above, parameter “fO” is a shifting offset parameterwhich is used to determine parameter “oW.” Parameter “sW” is a shiftingnumber parameter. “p[i]” is reference sample. Symbol “>>” is a binaryright shifting operator as defined in the H.265 standard.

In equation (C) above, “mWeight[i][j]” is an MIP weighting matrix inwhich matrix elements are fixed constants for both encoding anddecoding. Alternatively, in some embodiments, an implementation of theencoding system 200 uses adaptive MIP matrix. For example, the MIPweighting matrix can be updated by various training methods using one ormore coded pictures as input, or using pictures provided to the encodingsystem 200 by external means. The intra prediction unit can forward“mWeight[i][j]” to the entropy coding unit (e.g., the entropy codingunit 215) when an MIP mode is determined. The entropy coding unit canthen write “mWeight[i][j]” in the bitstream, e.g. in one or more specialdata units in the bitstream containing MIP data. Correspondingly, insome embodiments, an implementation of a decoding system 400 withadaptive MIP matrix can update MIP matrix using, for example, trainingmethod with input of one or more coded pictures or blocks or picturesfrom other bitstream provided to the decoder 200 by external meanings,or obtained from parsing unit 401 by parsing special data units in theinput bistream containing MIP matrix data.

The prediction unit 301 can determine the values of “sW” and “fO” basedon the size of the current block 300 and the MIP mode used for thecurrent block 300. In some embodiments, the prediction unit 301 canobtain the values of “sW” and “fO” by using a look-up table. Forexample, Table 1 below can be used to determine “sW.”

TABLE 1 sW modeId MipSizeId 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 170 6 6 6 5 6 5 5 6 5 6 6 6 6 6 5 6 5 5 1 6 6 6 6 6 6 6 6 6 7 2 7 5 6 6 66

Alternatively, Table 2 below can also be used to determine “sW.”

TABLE 2 MipSizeId sW 0 5 1 6 2 5

In some embodiments, the prediction module can set “sW” as a constant.For example, the prediction module can “sW” as “5” for blocks of varioussizes with different MIP modes. As another example, the predictionmodule 301 can set “sW” as “6” for blocks of various sizes withdifferent MIP modes. As yet another example, the prediction module canset “sW” as “7” for blocks of various sizes with different MIP modes.

In some embodiments, the prediction unit 301 can use Table 3 or Table 4below to determine “fO.”

TABLE 3 fO modeId MipSizeId 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 170 34 19 7 32 27 24 21 13 24 15 27 20 16 7 20 23 21 24 1 17 20 11 21 1711 23 10 21 11 2 8 46 16 10 13 11

TABLE 4 MipSizeId fO 0 34 1 23 2 46

In some embodiments, the prediction module 301 can directly set “fO” asa constant (e.g., a value from 0 to 100). For example, the predictionmodule 301 can set “fO” as “46” for blocks of various sizes withdifferent MIP modes. As another example, the prediction module 301 canset “fO” as “56.” As yet another example, the prediction module 301 canset “fO” as “66.”

In some embodiments, the intra prediction unit can perform a “clipping”operation on the value of the MIP prediction samples stored in array“predMip.” When “isTransposed” is 1 (or TRUE), the “predSize x preSize”array “predMip[x][y] (for x from 0 to “predSize-1; for y from 0 to“predSize-1”) is transposed as “predTemp[y][x]=predMip[x][y]” and then“predMip=predTemp.”

More particularly, when the size of the coding block 303 is “8×8” (i.e.both “cbWidth” and “cbHeight” are 8), the intra prediction unit canderive an “8×8” “predMip” array.

Step 303

In Step 303 in FIG. 3, the intra prediction unit derives predictedsamples 37 of the remaining samples other than the partial samples 35 inthe coding block 300. As shown in FIG. 3, the intra prediction unit canuse the filtering module 302 to derive the predicted samples 37 of theremaining samples other than the partial samples 35 in the coding block300. An input to the filtering module 302 can be the partial samples 35in step 302. The filtering module 302 can use one or more interpolationfilters to derive the predicted samples 37 of the remaining samplesother than the partial samples 35 in the coding block 300. The intraprediction unit (or the filtering module 302) can generate a prediction(which includes multiple predicted samples 37) of the coding block 300and store prediction 37 in an array “predSamples[x][y]” (for x from 0 to“nTbW-1,” for y from 0 to “nTbH-1”) according to the followingconditions K and L.

[CONDITION K] If the intra prediction unit determines that “nTbW” isgreater than “predSize” or that “nTbH” is greater than “predSize,” theintra prediction unit initiates an upsampling process to derive“predSamples” based on “predMip.”

[CONDITION L] Otherwise, the intra prediction unit sets the predictionof the coding block 300 as the MIP prediction of the coding block.

In other words, the intra prediction unit can set “predSamples[x][y](for x from 0 to “nTbW-1”, for y from 0 to “nTbH-1”) being equal to“predMip[x][y].” For example, the intra prediction unit can set“predSamples” for a coding block with its size equal to “8×8” (i.e. both“cbWidth” and “cbHeight” are 8) as its “predMip[x][y].”

Through the Steps 301-303, the intra prediction unit can generate theprediction of the current block 300. The generated prediction can beused for further processed (e.g., the prediction block 23 discussedabove with reference to FIG. 2).

FIG. 4 is a schematic diagram of a decoding system 400 according to anembodiment of the present disclosure. The decoding system 400 isconfigured to receive, process, and transform an input bitstream 40 toan output video 41. The input bitstream 40 can be a bitstreamrepresenting a compressed/coded picture/video. In some embodiments, theinput bitstream 40 can be from an output bitstream (e.g., the outputbitstream 21) generated by an encoding system (such as the encodingsystem 200).

The decoding system 400 includes a parsing unit 401 configured to parsethe input bitstream 40 to obtain values of syntax elements therefrom.The parsing unit 401 also converts binary representations of the syntaxelements to numerical values (i.e. a decoding block 42) and forwards thenumerical values to a prediction unit 402 (e.g., for decoding). In someembodiments, the parsing unit 401 can also forward one or more variablesand/or parameters for decoding the numerical values to the predictionunit 402.

The prediction unit 402 is configured to determine a prediction block 43of the decoding block 42 (e.g., a CU or a partition of a CU, such as atransform block). When it is indicated that an inter coding mode wasused to decode the decoding block 42, an MC (motion compensation) unit403 of the prediction unit 402 can receive relevant parameters from theparsing unit 401 and accordingly decode under the inter coding mode.When it is indicated that an intra prediction mode (e.g., an MIP mode)is used to decode the decoding block 42, an intra prediction unit 404 ofthe prediction unit 402 receives relevant parameters from the parsingunit 401 and accordingly decodes under the indicated intra coding mode.In some embodiments, the intra prediction mode (e.g., the MIP mode) canbe identified by a specific flag (e.g., an MIP flag) embedded in theinput bitstream 40.

For example, when the MIP mode is identified, the intra prediction unit404 can determine the prediction block 43 (which includes multiplepredicted samples) based on the following methods (similar to the Steps301-303 described in FIG. 3).

First, the intra prediction unit 404 derives one or more referencesamples from neighboring samples of the decoding block 42 (similar toStep 301 in FIG. 3). For example, the intra prediction unit 404 cangenerate the reference samples by downsampling the neighboring samples,or directly extracting a portion from the neighboring samples.

The intra prediction unit 404 can then derive partial predicted samplesin the decoding block 42 using the reference samples, an MIP matrix anda shifting parameter (similar to Step 302 in FIG. 3). In someembodiments, the positions of the partial predicted samples can bepreset in the decoding clock 42. For example, the positions of thepartial predicted samples can be positions with odd horizontal andvertical coordinate values within the coding block. The shiftingparameter can include a shifting offset parameter and a shifting numberparameter, which can be used in shifting operations in generating thepartial predicted samples.

Finally, if the partial predicted samples of the decoding block 42 arederived, the intra prediction unit 404 derives predicted samples of theremaining samples other than the partial predicted samples in thedecoding block 42 (similar to Step 303 in FIG. 3). For example, theintra prediction unit 404 can use an interpolation filter to derive thepredicted samples, by using the partial predicted samples and theneighboring samples as inputs of the interpolation filter.

The decoding system 400 includes a scaling unit 405 with functionssimilar to those of the inverse quantization unit 210 of the encodingsystem 200. The scaling unit 405 performs scaling operations onquantized coefficients 44 (e.g., levels) from the parsing unit 401 so asto generate reconstructed coefficients 45.

A transform unit 406 has functions similar to those of the inversetransform unit 211 in the encoding system 200. The transform unit 406performs one or more transform operations (e.g., inverse operations ofone or more transform operations by the inverse transform unit 211) toget reconstructed residual 46.

An adder 407 adds the prediction block 43 from the prediction unit 402and the reconstructed residual 46 from the transform unit 406 to get areconstructed block 47 of the decoding block 42. The reconstructed block47 is also sent to the prediction unit 402 to be used as a reference(e.g., for other blocks coded in an intra prediction mode).

After all the decoding block 42 in a picture or a subpicture have beenreconstructed (i.e., a reconstructed block 48 is formed), a filteringunit 408 can perform an in-loop filtering on the reconstructed block 49.The filtering unit 408 contains one or more filters such as a deblockingfilter, a sample adaptive offset (SAO) filter, an adaptive loop filter(ALF), a luma mapping with chroma scaling (LMCS) filter, aneural-network-based filter, etc. In some embodiments, the filteringunit 408 can perform the in-loop filtering on only one or more targetpixels in the reconstructed block 48.

The filtering unit 408 then send a decoded picture 49 (or picture) orsubpicture to a DPB (decoded picture buffer) 409. The DPB 409 outputsdecoded pictures as the output video 41 based on timing and controllinginformation. Decoded pictures 49 stored in the DPB 409 can also beemployed as a reference picture by the prediction unit 402 whenperforming an inter or intra prediction.

In some embodiment, the decoding system 400 can be a computing devicewith a processor and a storage medium recording one or more decodingprograms. When the processor reads and executes the decoding programs,the decoding system 400 can receive an input video bitstream andgenerate corresponding decoded video.

In some embodiments, the decoding system 400 can be a computing devicewith one or more chips. The units or elements of the decoding system 400can be implemented as integrated circuits on the chips.

FIG. 5 is a schematic diagram of an apparatus 500 according to anembodiment of the present disclosure. The apparatus 500 can be a“sending” apparatus. More particularly, the apparatus 500 is configuredto acquire, encode, and store/send one or more pictures. The apparatus500 includes an acquisition unit 501, an encoder 502, and astorage/sending unit 503.

The acquisition unit 501 is configured to acquire or receive a pictureand forward the picture to the encoder 502. The acquisition unit 501 canalso be configured to acquire or receive a video consisting of asequence of pictures and forward the video to the encoder 502. In someembodiments, the acquisition unit 501 can be a device containing one ormore cameras (e.g., picture cameras, depth cameras, etc.). In someembodiments, the acquisition unit 501 can be a device that can partiallyor completely decode a video bitstream to generate a picture or a video.The acquisition unit 501 can also contain one or more elements tocapture audio signal.

The encoder 502 is configured to encode the picture from the acquisitionunit 501 and generates a video bitstream. The encoder 502 can also beconfigured to encode the video from the acquisition unit 501 andgenerates the bitstream. In some embodiment, the encoder 502 can beimplemented as the encoding system 200 described in FIG. 2. In someembodiments, the encoder 502 can contain one or more audio encoders toencode audio signals to generate an audio bitstream.

The storage/sending unit 503 is configured to receive one or both of thevideo and audio bitstreams from the encoder 502. The storage/sendingunit 503 can encapsulate the video bitstream together with the audiobitstream to form a media file (e.g., an ISO-based media file) or atransport stream. In some embodiments, the storage/sending unit 503 canwrite or store the media file or the transport stream in a storage unit,such as a hard drive, a disk, a DVD, a cloud storage, a portable memorydevice, etc. In some embodiments, the storage/sending unit 503 can sendthe video/audio bitstreams to an external device via a transportnetwork, such as the Internet, a wired networks, a cellular network, awireless local area network, etc.

FIG. 6 is a schematic diagram of an apparatus 600 according to anembodiment of the present disclosure. The apparatus 600 can be a“destination” apparatus. More particularly, the apparatus 600 isconfigured to receive, decode, and render picture or video. Theapparatus 600 includes a receiving unit 601, a decoder 602, and arendering unit 603.

The receiving unit 601 is configured to receive a media file or atransport stream, e.g., from a network or a storage device. The mediafile or the transport stream includes a video bitstream and/or an audiobitstream. The receiving unit 601 can separate the video bitstream andthe audio bitstream. In some embodiments, the receiving unit 601 cangenerate a new video/audio bitstream by extracting the video/audiobitstream.

The decoder 602 includes one or more video decoders such as the decodingsystem 400 discussed above. The decoder 602 can also contain one or moreaudio decoders. The decoder 602 decodes the video bitstream and/or theaudio bitstream from the receiving unit 601 to get a decoded video fileand/or one or more decoded audio files (corresponding to one or multiplechannels).

The rendering unit 603 receives the decoded video/audio files andprocesses the video/audio files to get suitable video/audio signal fordisplaying/playing. These adjusting/reconstructing operations caninclude one or more of the following: denoising, synthesis, conversionof color space, upsampling, downsampling, etc. The rendering unit 603can improve qualities of the decoded video/audio files.

FIG. 7 is a schematic diagram of a communication system 700 according toan embodiment of the present disclosure. The communication system 700includes a source device 701, a storage medium or transport network 702,and a destination device 703. In some embodiments, the source device 701can be the apparatus 500 described above with reference to FIG. 5. Thesource device 701 sends media files to the storage medium or transportnetwork 702 for storing or transporting the same. The destination device703 can be the apparatus 600 described above with reference to FIG. 6.The communication system 700 is configured to encode a media file,transport or store the encoded media file, and then decode the encodedmedia file. In some embodiments, the source device 701 can be a firstsmartphone, the storage medium 702 can be a cloud storage, and thedestination device can be a second smartphone.

The above-described embodiments are merely illustrative of severalembodiments of the present disclosure, and the description thereof isspecific and detailed. The above embodiments cannot be construed tolimit the present disclosure. It should be noted that, a number ofvariations and modifications may be made by those skilled in the artwithout departing from the spirit and scope of the disclosure.Therefore, the scope of the present disclosure should be subject to theappended claims.

1. A method for decoding a picture, comprising: parsing a bitstream todetermine a width, a height and a prediction mode of a coding block;when the prediction mode indicates a matrix-based intra prediction (MIP)mode is used in decoding the coding block, if the width and the heightare equal to N, determining an MIP size identifier indicating that anMIP prediction size equal to N, wherein N is a positive integer power of2; deriving a group of reference samples of the coding block; andderiving an MIP prediction of the coding block based on the group ofreference samples and an MIP matrix corresponding to the MIP sizeidentifier.
 2. The method of claim 2, wherein deriving the MIPprediction of the coding block based on the group of reference samplesand the MIP matrix corresponding to the MIP size identifier comprises:deriving the MIP prediction of the coding block based on followingequations:${{oW} = {\left( {{1{\operatorname{<<}{(sW}}}\; - 1} \right) - {{fO}*\left( {\sum\limits_{i = 0}^{{inSize} - 1}\;{p\lbrack i\rbrack}} \right)}}},{and}$${{{{predMip}\lbrack x\rbrack}\lbrack y\rbrack} = {\left( {\left( {\left( {\sum\limits_{i = 0}^{{inSize} - 1}{{{{mWeight}\lbrack i\rbrack}\left\lbrack {{y*{predSize}} + x} \right\rbrack}*{p\lbrack i\rbrack}}} \right) + {oW}} \right)\operatorname{>>}{sW}} \right) + {{pTemp}\lbrack 0\rbrack}}},$ for x from 0 to “predSize-1”, for y from 0 to “predSize-1”, wherein“sW” represents a shifting number parameter, “fO” represents a shiftingoffset parameter, “inSize” represents a variable indicating the numberof reference samples used in deriving the MIP prediction, “p[i]”represents a reference sample, “predMip[x][y]” represents the MIPprediction, “mWeight[i][j]” represents an MIP weighting matrix,“predSize” represents a size of the MIP prediction, “pTemp[0]”represents the 0-th value in a reference sample buffer, symbol “<<”represents a binary left shifting operator, and symbol “>>” represents abinary right shifting operator.
 3. The method of claim 2, furthercomprising: downsampling the group of reference samples of the codingblock to obtain the reference sample buffer, wherein the referencesample buffer contains the downsampled group of reference samples of thecoding block; and determining an input sample according to referencesamples in the reference sample buffer, the MIP size identifier, and abitdepth of luminance component.
 4. The method of claim 3, whereindetermining the input sample according to reference samples in thereference sample buffer, the MIP size identifier, and the bitdepth ofluminance component comprises: deriving the input sample based onfollowing conditions: if the MIP size identifier is equal to 2,p[x]=pTemp[x+1]−pTemp[0]; if the MIP size identifier is less than 2,$\left\{ {\begin{matrix}{\left. {{p\lbrack 0\rbrack} = \left( {{1{\operatorname{<<}{(BitDepth}}}\; - 1} \right)} \right) - {{pTemp}\lbrack 0\rbrack}} & \; \\{{p\lbrack x\rbrack} = {{{pTemp}\lbrack x\rbrack} - {{pTemp}\lbrack 0\rbrack}}} & {{{{for}\mspace{14mu} x} = 1},\ldots\mspace{14mu},{{inSize} - 1}}\end{matrix},} \right.$  wherein “p[x]” represents the reference sample,“pTemp[x]” represents the x-th value in the reference sample buffer, and“BitDepth” represents the bitdepth of luminance component.
 5. The methodof claim 4, wherein the MIP size identifier is set as 0 on conditionthat the width and the height of the coding block are equal to 4; theMIP size identifier is set as 1 on condition that the width×height isequal to N×4, 4×N, or 8×8; or the MIP size identifier is set as 2 oncondition that the width and the height of the coding block are notequal to 4 and the width×height is not equal to N×4, 4×N, or 8×8.
 6. Themethod of claim 2, wherein deriving the MIP prediction of the codingblock based on the group of reference samples and an MIP matrixcorresponding to the MIP size identifier further comprises: determiningthe shifting number parameter; and deriving the MIP prediction of thecoding block based on the group of reference samples, the shiftingnumber parameter, and the MIP matrix according to the MIP sizeidentifier, wherein different MIP size identifiers correspond to thesame shifting number parameter, and the shifting number parameter is aconstant equal to
 6. 7. The method of claim 2, wherein deriving the MIPprediction of the coding block based on the group of reference samplesand an MIP matrix corresponding to the MIP size identifier furthercomprises: determining the shifting offset parameter; and deriving theMIP prediction of the coding block based on the group of referencesamples, the shifting offset parameter, and the MIP matrix according tothe MIP size identifier, wherein different MIP size identifierscorrespond to the same shifting offset parameter, and the shiftingoffset parameter is a constant equal to
 32. 8. The method of claim 1,further comprising deriving the group of reference samples of the codingblock based on neighboring samples, wherein the neighboring samplesinclude above-neighboring samples and/or left-neighboring samples. 9.The method of claim 1, further comprising setting a prediction of thecoding block equal to the MIP prediction of the coding block.
 10. Amethod for encoding a picture, comprising: determining a width and aheight of a coding block in the picture; if the width and the height areequal to N, wherein N is a positive integer power of 2, determining amatrix-based intra prediction (MIP) size identifier indicating that anMIP prediction size equal to N; deriving a group of reference samples ofthe coding block; and deriving an MIP prediction of the coding blockbased on the group of reference samples and an MIP matrix according tothe MIP size identifier.
 11. The method of claim 10, wherein derivingthe MIP prediction of the coding block based on the group of referencesamples and the MIP matrix according to the MIP size identifiercomprises: deriving the MIP prediction of the coding block based onfollowing equations:${{oW} = {\left( {{1{\operatorname{<<}{(sW}}}\; - 1} \right) - {{fO}*\left( {\sum\limits_{i = 0}^{{inSize} - 1}\;{p\lbrack i\rbrack}} \right)}}},{and}$${{{{predMip}\lbrack x\rbrack}\lbrack y\rbrack} = {\left( {\left( {\left( {\sum\limits_{i = 0}^{{inSize} - 1}{{{{mWeight}\lbrack i\rbrack}\left\lbrack {{y*{predSize}} + x} \right\rbrack}*{p\lbrack i\rbrack}}} \right) + {oW}} \right)\operatorname{>>}{sW}} \right) + {{pTemp}\lbrack 0\rbrack}}},$ for x from 0 to “predSize-1”, for y from 0 to “predSize-1”, wherein“sW” represents a shifting number parameter, “fO” represents a shiftingoffset parameter, “inSize” represents a variable indicating the numberof reference samples used in deriving the MIP prediction, “p[i]”represents a reference sample, “predMip[x][y]” represents the MIPprediction, “mWeight[i][j]” represents an MIP weighting matrix,“predSize” represents a size of the MIP prediction, “pTemp[0]”represents the 0-th value in a reference sample buffer, symbol “<<”represents a binary left shifting operator, and symbol “>>” represents abinary right shifting operator.
 12. The method of claim 11, furthercomprising: downs ampling the group of reference samples of the codingblock to obtain the reference sample buffer, wherein the referencesample buffer contains the downsampled group of reference samples of thecoding block; and determining an input sample according to referencesamples in the reference sample buffer, the MIP size identifier, and abitdepth of luminance component.
 13. The method of claim 12, whereindetermining the input sample according to reference samples in thereference sample buffer, the MIP size identifier, and the bitdepth ofluminance component comprises: deriving the input sample based onfollowing conditions: if the MIP size identifier is equal to 2,p[x]=pTemp[x+1]−pTemp[0]; if the MIP size identifier is less than 2,$\left\{ {\begin{matrix}{\left. {{p\lbrack 0\rbrack} = \left( {{1{\operatorname{<<}{(BitDepth}}}\; - 1} \right)} \right) - {{pTemp}\lbrack 0\rbrack}} & \; \\{{p\lbrack x\rbrack} = {{{pTemp}\lbrack x\rbrack} - {{pTemp}\lbrack 0\rbrack}}} & {{{{for}\mspace{14mu} x} = 1},\ldots\mspace{14mu},{{inSize} - 1}}\end{matrix},} \right.$  wherein “p[x]” represents the reference sample,“pTemp[x]” represents the x-th value in the reference sample buffer, and“BitDepth” represents the bitdepth of luminance component.
 14. Themethod of claim 13, wherein the MIP size identifier is set as 0 oncondition that the width and the height of the coding block are equal to4; the MIP size identifier is set as 1 on condition that thewidth×height is equal to N×4, 4×N, or 8×8; or the MIP size identifier isset as 2 on condition that the width and the height of the coding blockare not equal to 4 and the width×height is not equal to N×4, 4×N, or8×8.
 15. The method of claim 11, wherein deriving the MIP prediction ofthe coding block based on the group of reference samples and an MIPmatrix according to the MIP size identifier further comprises:determining the shifting number parameter; and deriving the MIPprediction of the coding block based on the group of reference samples,the shifting number parameter, and the MIP matrix according to the MIPsize identifier, wherein different MIP size identifiers correspond tothe same shifting number parameter, and the shifting number parameter isa constant equal to
 6. 16. The method of claim 11, wherein deriving theMIP prediction of the coding block based on the group of referencesamples and an MIP matrix according to the MIP size identifier furthercomprises: determining the shifting offset parameter; and deriving theMIP prediction of the coding block based on the group of referencesamples, the shifting offset parameter, and the MIP matrix according tothe MIP size identifier, wherein different MIP size identifierscorrespond to the same shifting offset parameter, and the shiftingoffset parameter is a constant equal to
 32. 17. The method of claim 10,further comprising deriving the group of reference samples of the codingblock based on neighboring samples, wherein the neighboring samplesinclude above-neighboring samples and/or left-neighboring samples. 18.The method of claim 10, further comprising setting a prediction of thecoding block equal to the MIP prediction of the coding block.
 19. Adecoder for decoding a picture, comprising: a processor; and a memorystoring one or more computer programs which, when executed by theprocessor, cause the processor to: parse a bitstream to determine awidth, a height and a prediction mode of a coding block; and when theprediction mode indicates a matrix-based intra prediction (MIP) mode isused in decoding the coding block, determine an MIP size identifierindicating that an MIP prediction size equal to N, if the width and theheight are equal to N, wherein N is a positive integer power of 2, andwherein the processor is configured to derive a group of referencesamples of the coding block, and wherein the processor is configured toderive an MIP prediction of the coding block based on the group ofreference samples and an MIP matrix corresponding to the MIP sizeidentifier.
 20. An encoder for encoding a picture, comprising: aprocessor; and a memory storing one or more computer programs which,when executed by the processor, cause the processor to: receive an inputpicture and divide the input picture into one or more coding blocks;determine a width and a height of the coding block, wherein if the widthand the height are equal to N, the processor is configured to determinea matrix-based intra prediction (MIP) size identifier indicating that anMIP prediction size equal to N, wherein N is a positive integer power of2, and wherein the processor is configured to derive a group ofreference samples of the coding block, and wherein the processor isconfigured to derive an MIP prediction of the coding block based on thegroup of reference samples and an MIP matrix according to the MIP sizeidentifier; and transform parameters to derive the MIP prediction into abitstream.